-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
welcoming robots in certain situations #613
Conversation
bin/robot-factory
Outdated
@@ -0,0 +1,10 @@ | |||
#!/bin/bash | |||
|
|||
if [[ "$CURRENT_GIT_URL" == "$PROD_GIT_URL" && "$PROD_GIT_BRANCH" == "$CURRENT_GIT_BRANCH" ]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to move this check out into the circle-ci
config? I think I like it better there, but open to other opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this? I'm agnostic.
Didn't work when I tried it, that's how I got sent down the environment variable route but I think I know why that was.
- when: # prod
condition:
and:
- equal: [<< pipeline.project.git_url >>, << pipeline.parameters.prod_git_url >>]
- equal: [<< pipeline.git.branch >>, << pipeline.parameters.prod_git_branch >>]
steps:
- build_robot: #build robot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah something like that. If you can't get it to work I think it is fine to leave it in the script.
Co-authored-by: Josh Salisbury <[email protected]>
Description of change
Right now, the same robots.txt file is served across all environments, in which all indexing is allowed, leading to Google indexing non-prod environments. This PR makes the robots.txt file disallow all by default and adds a bash script that runs on deploy. If the deploy is for prod, then the robots.txt file will be altered to allow indexing.
How to test
I have tested this out by adding a comment to the robots.txt on dev.
Issue(s)
Checklists
Every PR
Production Deploy
After merge/deploy